import 'package:mall/core/models/store_product_query.dart';
import 'package:json_annotation/json_annotation.dart';

part 'store_search.g.dart';

@JsonSerializable()
class StoreSearch {
  final Model models;

  StoreSearch(this.models);

  factory StoreSearch.fromJson(Map<String, dynamic> json) => _$StoreSearchFromJson(json);

  Map<String, dynamic> toJson() => _$StoreSearchToJson(this);
}

@JsonSerializable()
class Model {
  final List<Store> content;

  Model(this.content);

  factory Model.fromJson(Map<String, dynamic> json) => _$ModelFromJson(json);

  Map<String, dynamic> toJson() => _$ModelToJson(this);
}

@JsonSerializable()
class Store {
  final int id;
  final String name;
  final String levelText;
  final String logoUrl;
  final String storeTypeText;
  final List<Product> topProducts;

  Store(
    this.id,
    this.name,
    this.levelText,
    this.logoUrl,
    this.storeTypeText,
    this.topProducts,
  );

  factory Store.fromJson(Map<String, dynamic> json) => _$StoreFromJson(json);

  Map<String, dynamic> toJson() => _$StoreToJson(this);
}
